#include <iostream>
#include <ctemplate/template.h>

int main()
{
    std::string inhtml = "./test.html";
    std::string value = "要替换的值";

    // 形成数据字典
    ctemplate::TemplateDictionary root("test"); // unordered_map<> test();
    root.SetValue("key", value); // test.insert();
    // 获取被渲染网页对对象
    ctemplate::Template *tpl = ctemplate::Template::GetTemplate(inhtml, ctemplate::DO_NOT_STRIP);
    // 添加字段数据到网页中
    std::string outhtml;
    tpl->Expand(&outhtml, &root);

    std::cout  << outhtml << std::endl;
    return 0;
}